<template>
  <div class="value-page">
    <!-- 项目基本信息 -->
    <a-descriptions bordered :column="2" size="small" class="col-span-2">
      <a-descriptions-item label="项目编号">
        {{ projectAuditInfo.projectBuild.projectNo }}
      </a-descriptions-item>
      <a-descriptions-item label="项目名称">
        {{ projectAuditInfo.projectBuild.projectName }}
      </a-descriptions-item>
      <a-descriptions-item label="经办经营体">
        {{ projectAuditInfo.projectBuild.mainDeptName }}
      </a-descriptions-item>
      <a-descriptions-item label="申请人">
        {{ projectAuditInfo.projectBuild.createUserName }}
      </a-descriptions-item>
    </a-descriptions>
    <a-descriptions bordered :column="1" size="small">
      <a-descriptions-item label="申请事由">{{ projectAuditInfo.projectBuildCompany.applyReason }}</a-descriptions-item>
      <a-descriptions-item label="公司名称">{{ projectAuditInfo.projectBuildCompany.companyName }}</a-descriptions-item>
    </a-descriptions>

    <a-descriptions bordered :column="2" class="col-span-2" size="small" v-if="projectAuditInfo.projectBuildCompany.newOrChange != '注销法人公司'">
      <a-descriptions-item label="新建/变更">{{
        projectAuditInfo.projectBuildCompany.newOrChange
      }}</a-descriptions-item>
      <a-descriptions-item label="公司类型">
        {{
          projectAuditInfo.projectBuildCompany.companyTypeName
            ? projectAuditInfo.projectBuildCompany.companyTypeName
            : projectAuditInfo.projectBuildCompany.companyType
        }}
      </a-descriptions-item>

      <a-descriptions-item label="注册资本" v-if="projectAuditInfo.projectBuildCompany.newOrChange == '新建法人公司'">
        {{
          projectAuditInfo.projectBuildCompany.registeredCapital
            ? projectAuditInfo.projectBuildCompany.registeredCapital +
              '' +
              (projectAuditInfo.projectBuildCompany.unitName ? projectAuditInfo.projectBuildCompany.unitName : '万元')
            : '--'
        }}
      </a-descriptions-item>
      <a-descriptions-item label="公司性质" v-if="projectAuditInfo.projectBuildCompany.newOrChange == '新建法人公司'">{{
        projectAuditInfo.projectBuildCompany.companyNatureName
      }}</a-descriptions-item>
    </a-descriptions>
    <a-descriptions bordered :column="2" size="small" class="col-span-2" v-if="projectAuditInfo.projectBuildCompany.newOrChange == '注销法人公司'">
      <a-descriptions-item label="新建/变更/注销">{{
        projectAuditInfo.projectBuildCompany.newOrChange
      }}</a-descriptions-item>
      <a-descriptions-item label="注销时间">{{
        projectAuditInfo.projectBuildCompany.cancelTime
      }}</a-descriptions-item>
      <a-descriptions-item label="注销风险及管控措施">{{
        projectAuditInfo.projectBuildCompany.cancelRisk
      }}</a-descriptions-item>
    </a-descriptions>
    <a-descriptions
      bordered
      :column="1"
      size="small"
      v-if="projectAuditInfo.projectBuildCompany.newOrChange == '新建法人公司'"
    >
      <a-descriptions-item label="住所">{{ projectAuditInfo.projectBuildCompany.residence }}</a-descriptions-item>
      <a-descriptions-item label="经营范围">{{
        projectAuditInfo.projectBuildCompany.businessScope
      }}</a-descriptions-item>
    </a-descriptions>

    <section v-for="(item, index) of tableList" :key="index" v-show="item.showFlag && item.data.length > 0">
        <a-table
          :columns="item.columns"
          :data-source="item.data"
          bordered
          size="small"
          :rowKey="
            (record, index) => {
              return index
            }
          "
          :pagination="false"
        >
        </a-table>
      </section>
  </div>
</template>

<script>
import { getAction, postAction } from '@/api/manage'
import { getParamValFromUrl, caseToShow } from '@/utils/common.js'
export default {
  name: 'ProjectBuildBasicMCompany',
  components: {},
  data() {
    return {
      requrl: {
        codeInfoList: '/manage/codeInfo/list',
      },
      tableList: [
        {
          title: '主要人员信息',
          model: 'mainPerson',
          showFlag: true,
          columns: [
            { title: '主要人员信息', dataIndex: 'index', width: '20%', align: 'center',customRender: (text, record, index) => `${index + 1}`, },
            { title: '职位', dataIndex: 'jobPositionName', width: '40%' },
            { title: '姓名', dataIndex: 'fullName', width: '40%', align: 'center' },
          ],
          data: this.projectAuditInfo.projectBuildCompany.mainPersonList,
        },
        {
          title: '股东信息',
          model: 'assess',
          showFlag: this.projectAuditInfo.projectBuildCompany.newOrChange == '新建法人公司',
          columns: [
            { title: '股东信息', dataIndex: 'index', width: '20%', align: 'center',customRender: (text, record, index) => `${index + 1}`, },
            { title: '股东', dataIndex: 'shareholder', width: '40%', align: 'center' },
            { title: '股权比例', dataIndex: 'ownershipRatio', width: '40%', align: 'center' }
          ],
          data: this.projectAuditInfo.projectBuildCompany.shareholderList,
        },
        {
          title: '变更事项',
          model: 'change',
          showFlag: this.projectAuditInfo.projectBuildCompany.newOrChange != '新建法人公司',
          columns: [
            { title: '变更事项', dataIndex: 'changeOptionName', width: '20%', align: 'center' },
            { title: '原登记内容', dataIndex: 'shareholder', width: '40%', align: 'center' },
            { title: '现登记内容', dataIndex: 'newContent', width: '40%', align: 'center' }
          ],
          data: this.projectAuditInfo.projectBuildCompany.shareholderList,
        }
      ],
    }
  },
  mounted() {},
  props: {
    projectAuditInfo: {
      Type: Object,
      default: '',
    },
  },
  methods: {
    caseToShow(obj) {
      return caseToShow(obj)
    },
  },
}
</script>
<style lang="less" scoped>
/deep/.ant-checkbox-disabled + span {
  color: black;
}
.project-info {
  color: black;
  .info-detail {
    background-color: #fff;
    border: 1px solid #ebebeb;
    padding: 1% 2.5%;
    margin-bottom: 15px;
    position: relative;
    font-size: 16px;
    > span {
      display: inline-block;
      margin-left: 15px;
    }
    .list-title {
      font-weight: 900;
      height: unset;
      line-height: 28px;
    }
    .row-content {
      display: flex;
      align-items: baseline;
      > span {
        white-space: normal;
      }
    }
    .info-list {
      padding: unset;
      display: flex;
      flex-wrap: wrap;
      margin-bottom: 0;
      > li {
        width: 33.33%;
        padding: 3px 0;
        height: auto;
        display: flex;
        align-items: center;
        // >img{
        //   margin-right: 5px;
        // }
        .comment {
          white-space: pre-wrap;
        }
        span {
          // line-height: 1.2;
        }
      }
      .left {
        display: flex;
        align-items: baseline;
      }
      .one-row {
        width: 100%;
        align-items: baseline;
        height: auto;
        padding: 3px 0px;
        > span {
          width: calc(100% - 170px);
        }
      }
    }
    .info-content {
      .content-title {
        display: flex;
        align-items: center;
        font-weight: 900;
        img {
          margin-right: 5px;
        }
      }
      .content-box {
        padding: 5px 16px 0;
      }
    }
  }
}
</style>